package com.itheima.service.impl;

import com.itheima.dao.ItemsDao;
import com.itheima.pojo.Items;
import com.itheima.service.ItemsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author a2687
 * @create 2021/9/13 17:18
 */
@Service
@Transactional
public class ItemsServiceImpl implements ItemsService {
    @Autowired
    ItemsDao itemsDao;
    public List<Items> findAll() {
        return itemsDao.findAll();
    }

    public int save(Items items) {
        int rows=itemsDao.save(items);
        //System.out.println(1/0);

        return rows;
    }
}
